<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.5"></script>

<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
#SWFUpload_1{
	margin-top: 70px;
    margin-left: -30px;
}
</style>
<script>
var contextPath='${contextPath}';
var _contextPath = '${staticServer}';

$(function(){
	$("#type").val("<#if demand??>${demand.type}</#if>");
	$("#fz_username").val("<#if demand??>${demand.fz_username}</#if>");
	$("#kf_username").val("<#if demand??>${demand.kf_username}</#if>");
	$("#hz_username").val("<#if demand??>${demand.hz_username}</#if>");
	$("#state").val("<#if demand??>${demand.state}</#if>");
});

var addDemand = function(){
	var id = $("#id").val();
	var title = $("#titles").val();
	var type = $("#type").val();
	var fz_username = $("#fz_username").val();
	var kf_username = $("#kf_username").val();
	var hz_username = $("#hz_username").val();
	
	var content = $("#content").val();
	var startTime = $("#startTime").val();
	var endTime = $("#endTime").val();
	var img_url = $("#all_words").val();
	var data_url = $("#all_words4").val();
	
	var state = $("#state").val();
	
	if(fz_username==""){
		infopad.err("请选择开发人员!");
		return;
	}
	if(type==""){
		infopad.err("请选择开发类型!");
		return;
	}
	
	$.post("${contextPath}/index/add_demand.json", {
			"id":id,
			"title":title,
			"type":type,
			"fz_username":fz_username,
			"kf_username":kf_username,
			"hz_username":hz_username,
			"content":content,
			"startTime":startTime,
			"endTime":endTime,
			"img_url":img_url,
			"data_url":data_url,
			"state":state
		}, function(ms) {
		    var msg = ms.msg;
		    if(msg!=null && msg=="1"){
				infopad.msg("操作成功！");
				window.location.href="${contextPath}/index/demandList.htm";
		    }else{
		    	infopad.err("操作失败，请联系管理员！");
		    }
			
	});
};

function getImg(img_url){
	window.location.href=img_url;
}
</script>
</head>
<input type="hidden" id="id" value="<#if demand??>${demand.id}</#if>">
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>

	<div id="container">
		<div id="title">添加项目需求</div>
		<table id="infotable">
			
			<tr>
				<th>需求名称:</th>
				<td>
					<span style="font-weight:bold;font-size:16px;"><#if demand??>${demand.title}</#if></span>
				</td>
			</tr>
			
			<tr>
				<th>开发类型:</th>
				<td>
					<span style="font-weight:bold;">
					<#if demand??>
						<#if demand.type==1>
							OA系统
						<#elseif demand.type=="2">
							前端
						<#elseif demand.type=="3">
							IOS
						<#elseif demand.type=="4">
							训练系统
						</#if>
					</#if>
					</span>
				</td>
			</tr>
			
			<tr>
				<th>开发时间:</th>
				<td style="height: 14px;">
					<span style="font-weight:bold;"><#if demand??>${demand.startTime}</#if>-<#if demand??>${demand.endTime}</#if></span>
				</td>
			</tr>
			
			<tr>
				<th>需求内容:</th>
				<td style="height: 14px;">
					<span style="font-weight:bold;">
						<#if demand??>${demand.content}</#if>
					</span>
				</td>
			</tr>
			
			<tr>
				<th>需求相关图片:</th>
				<td style="height: 14px;">
					<ul class="imglist">
					<div id="images" style="float: left;">
						<#if demand?? && demand.img_url?? && demand.img_url!="">
							<#list demand.img_url?split(",") as imgurl>
								<#if imgurl_index !=0>
									<li style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><img style="cursor:pointer;" width="180" height="109.125" onclick="getImg('http://120.55.241.58${imgurl}')" src="http://120.55.241.58${imgurl}"></li>
								</#if>
							</#list>
						</#if>
					</div>
					</ul>
				</td>
			</tr>
			
			<tr>
				<th>需求相关文件:</th>
				<td style="height: 14px;">
					<ul class="imglist">
					<div id="images4" style="float: left;">
						<#if demand?? && demand.data_url?? && demand.data_url!="">
							<#list demand.data_url?split(",") as dataurl>
								<#if dataurl_index !=0>
								<li style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><a href="http://120.55.241.58${dataurl}">文件下载</a></li>
								</#if>
							</#list>
						</#if>
					</div>
						
					</ul>
				</td>
			</tr>
			
			<tr>
				<th>开发老师:</th>
				<td style="height: 14px;">
					<span style="font-weight:bold;">
						<#if demand??>${demand.nickname3} &nbsp; ${demand.nickname4}</#if>
					</span>
				</td>
			</tr>
			
			
			<tr>
				<th>跟进老师:</th>
				<td style="height: 14px;">
					<span style="font-weight:bold;"><#if demand??>${demand.nickname2}</#if></span>
				</td>
			</tr>
			
			<tr>
				<th>完成时间:</th>
				<td style="height: 14px;">
					<span style="font-weight:bold;"><#if demand??>${demand.com_date}</#if></span>
				</td>
			</tr>
			
			<tr>
				<th>开发状态:</th>
				<td style="height: 14px;">
					<#if demand??>
						<#if demand=="1">
							待开发
						<#elseif demand.state=="2">
							正在开发
						<#elseif demand.state=="3">
							已完成
						</#if>
					</#if>
				</td>
			</tr>
			
		</table>
		<div id="controlbar">
			<input type="button" onclick="window.history.go(-1);" class="submit" value="  返回列表  " />
		</div>
	</div>
	
</body>
</html>